using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using Deepcode.Flux.Core.Systems.Workflow.Enums;

public partial class Private_Config_Workflow_ctrl_Timescale : System.Web.UI.UserControl
{
	#region Properties
	/// <summary>
	/// Get/Set the timescale unit selected
	/// </summary>
	public WorkflowTimescale TimescaleUnit
	{
		get
		{
			string sV = AtUnit.SelectedValue;
			int V = 0;
			try
			{
				V = Int32.Parse(sV);
			}
			catch
			{
				V = 0;
			}
			
			// Attempt to convert to timescale
			WorkflowTimescale wtV;
			try
			{
				wtV = (WorkflowTimescale)V;
			}
			catch
			{
				wtV = WorkflowTimescale.YEAR;
			}
			return wtV;
		}
		set
		{
			string sV = ((int)value).ToString();
			try
			{
				AtUnit.SelectedValue = sV;
			}
			catch
			{
				AtUnit.SelectedValue = "0";
			}
		}
	}
	/// <summary>
	/// Get/Set the number of timescale units
	/// </summary>
	public int NumberOfUnits
	{
		get
		{
			try
			{
				return Int32.Parse(At.Text);
			}
			catch
			{
				return 0;
			}
		}
		set
		{
			At.Text = value.ToString();
		}
	}
	#endregion
	protected void Page_Load(object sender, EventArgs e)
	{
	}
}
